﻿using System;
using Wei8808Cms.BLL;
using Wei8808Cms.Model;
using Wei8808Cms.Utility;
using Wei8808Cms.WebSite.UI;

namespace Wei8808Cms.WebSite
{
    public partial class NewDetail : WebSiteBaseicPage
    {
        private readonly NewsBLL _nbll = new NewsBLL();

        public string Id;

        protected NewsInfo model = new NewsInfo();

        protected void Page_Load(object sender, EventArgs e)
        {
            Id = Request.Params["id"];
            if (string.IsNullOrEmpty(Id))
            {
                Response.Redirect("News.aspx");
            }
            else
            {
                if (RequestCheck.CheckKeyWord(Id))
                {
                    Response.Redirect("News.aspx");
                }
                else
                {
                    LoadData();
                }
            }
        }

        public void LoadData()
        {
            model = _nbll.GetNewsInfo(Id);
            _nbll.UpdateField(this.Id, "Click=Click+1");
        }

    }
}